home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 3 / CD ACTUAL 3.iso / linux / incoming / jstools-.6v3 / jstools- / jstools-tk3.6v3.0 / lib / jdoc / jfs.tcl.jdoc < prev    next >
Encoding:
Text File  |  1995-03-14  |  13.1 KB  |  1 lines

  1. jfs.tcl\n\nIntroduction\nThe\ jfs.tcl\ library\ is\ distributed\ as\ part\ of\ the\ jstools\ package.\ \ It\ creates\ a\ general¡purpose\ modal\ file¡selection\ panel\ that\ allows\ the\ user\ to\ select\ a\ file\ (or\ directory)\ and\ returns\ its\ full\ pathname.\n\nThis\ document\ describes\ jfs.tcl\ version\ 3.6/3.0.\n\nUsage\nAccessing\ the\ Library\nIn\ order\ to\ use\ the\ jfs.tcl\ library,\ it\ (and\ any\ other\ libraries\ it\ depends\ on)\ must\ be\ in\ your\ Tcl\ auto_path,\ described\ in\ tclvars(n).\ \ Information\ about\ how\ to\ arrange\ that,\ and\ other\ conventions\ common\ to\ the\ jstools\ libraries,\ is\ in\ the\ Usage\ section\ of\ The\ jstools\ Libraries.\n\nCredits\ and\ Copyright\nAuthor\nJay\ Sekora\ \njs@bu.edu\nhttp://shore.net/~js/\n\nCopyright\nThe\ jfs.tcl\ library\ is\ copyright\ ⌐\ 1992-1994\ by\ Jay\ Sekora,\ but\ may\ be\ freely\ copied\ and\ modified\ for\ non¡commercial\ purposes.\ \ (Please\ contact\ me\ if\ you\ want\ to\ use\ it\ for\ a\ commercial\ purpose,\ this\ may\ be\ OK\ under\ some\ circumstances.)\n\nOverview\nProcedures\nj:fs\ -\ file\ selection\ panel\nj:fs:fill_list\ -\ fill\ j:fs\ listbox\ with\ files\ from\ current\ directory\n\nj:fs\nUsage\n\tj:fs\ \[options\]\n\nOptions\n\t-buttons\ buttonlist\ \ (default\ {ok\ cancel\ home})\n\t-prompt\ prompt\ \ (default\ Choose\ a\ file)\n\t-directory\ dir\ \ (default\ .)\n\t-cancelvalue\ cancelvalue\ \ (default\ {})\n\t-fileprompt\ \ fileprompt\ (default\ File:)\n\t-title\ title\ \ (default\ File\ Selector)\n\t-types\ typelist\ \ (default\ {})\n\t-typevariable\ typevar\ \ (default\ {})\n\t-typeprompt\ typeprompt\ \ (default\ File\ type:)\n\nExamples\n\tset\ filename\ \[j:fs\ -prompt\ \"Save\ as:\"\]\n\t\n\tset\ dirname\ \[j:fs\ -buttons\ {here\ cancel\ home\ root}\ \\\n\t\ \ -prompt\ \"Change\ directory\ to...\"\]\n\t\n\tset\ outfile\ \[j:fs\ -prompt\ \"Save\ as:\"\ \\\n\t\ \ -types\ {sc\ oleo\ \"Tab-separated\ values\"\ \"LaTeX\ table\"}\ \\\n\t\ \ -typevariable\ format\ -typeprompt\ \"Spreadsheet\ format:\"\]\n\nDescription\nThis\ procedure\ creates\ a\ file¡selection\ box\ with\ a\ configurable\ set\ of\ buttons,\ a\ label\ containing\ prompt\ at\ the\ top,\ a\ listbox\ showing\ the\ files\ in\ the\ current\ directory,\ and\ an\ entry\ labelled\ fileprompt\ at\ the\ bottom\ that\ lets\ the\ user\ type\ in\ a\ file\ name.\ \ The\ user\ can\ select\ an\ existing\ file\ either\ with\ the\ mouse\ or\ from\ the\ keyboard,\ and\ the\ entry\ supports\ filename\ completion\ with\ the\ Tab\ key.\ \ (A\ new\ file\ name,\ of\ course,\ has\ to\ be\ typed\ in.)\ \ The\ window¡manager\ name\ of\ the\ panel\ will\ be\ title.\n\nThe\ file\ selection\ panel\ has\ a\ number\ of\ pre¡defined\ buttons,\ and\ you\ can\ choose\ which\ ones\ appear\ using\ the\ -buttons\ option.\ \ The\ first\ button\ in\ buttonlist\ will\ be\ the\ default\ button,\ and\ pressing\ Return\ in\ the\ entry\ widget\ or\ double¡clicking\ in\ the\ listbox\ will\ do\ the\ same\ thing\ as\ clicking\ on\ this\ button\ (unless\ the\ current\ file\ name\ is\ a\ directory,\ in\ which\ case\ it\ will\ switch\ to\ that\ directory).\ \ If\ the\ -buttons\ option\ is\ not\ specified,\ the\ ok,\ cancel,\ and\ home\ buttons\ will\ be\ displayed\ (and\ ok\ will\ be\ the\ default\ button).\n\nThe\ available\ buttons\ and\ their\ functions\ are:\n\nok\ -\ Return\ the\ current\ filename\ if\ it\ is\ a\ file\;\ cd\ to\ it\ if\ it's\ a\ directory.\ \ This\ is\ the\ typical\ way\ to\ select\ a\ filename\n\ngointo\ -\ cd\ to\ the\ current\ filename,\ if\ it's\ a\ directory.\ \ This\ is\ useful\ when\ here\ is\ the\ default\ button.\n\nhome\ -\ cd\ to\ the\ user's\ home\ directory.\n\nroot\ -\ cd\ to\ the\ root\ directory.\n\nhere\ -\ Return\ the\ name\ of\ the\ current\ working\ directory.\ \ This\ can\ be\ used,\ for\ instance,\ to\ choose\ where\ to\ move\ a\ file\ to.\n\ncancel\ -\ Return\ cancelvalue.\n\nIf\ -types\ and\ -typevariable\ are\ specified,\ an\ option\ button,\ labelled\ typeprompt,\ will\ be\ displayed\ that\ lets\ the\ user\ choose\ among\ the\ file\ types\ in\ typelist.\ \ The\ j:fs\ procedure\ will\ set\ the\ variable\ typevar\ in\ the\ caller's\ scope\ to\ the\ element\ of\ typelist\ that\ the\ user\ selected.\ \ This\ is\ intended\ to\ let\ the\ user\ select\ a\ file\ format\ for\ saving,\ although\ it\ could\ conceivably\ be\ put\ to\ other\ uses.\n\nUnless\ the\ global\ variable\ J_PREFS(j_fs_fast)\ is\ true,\ directory\ names\ in\ the\ listbox\ will\ have\ a\ trailing\ slash\ (/).\ \ The\ user\ can\ set\ this\ with\ a\ small\ checkbox\ at\ the\ upper¡right\ of\ the\ file¡selection\ panel\ (as\ well\ as\ from\ the\ Global\ Preferences\ panel\ created\ by\ j:global_pref_panel,\ in\ jprefpanel.tcl).\n\nKeyboard\ shortcuts\ for\ the\ Cancel\ button\ are\ set\ up\ using\ j:cancel_button\ in\ jtkutils.tcl,\ even\ if\ it\ doesn't\ appear\ in\ buttonlist.\ \ This\ means\ that\ the\ user\ can\ always\ cancel\ (returning\ cancelvalue)\ by\ typing\ (e.g.)\ Control-c,\ even\ if\ you\ didn't\ include\ cancel\ in\ buttonlist.\n\nNote\ that\ while\ j:fs\ may\ change\ the\ working\ directory\ while\ it's\ active\ (i.e.,\ when\ the\ user\ goes\ into\ a\ directory,\ j:fs\ cds\ into\ that\ directory\ to\ display\ its\ contents),\ it\ restores\ the\ original\ working\ directory\ before\ it\ returns.\ \ Since\ j:fs\ is\ modal,\ this\ means\ that\ you\ don't\ have\ to\ worry\ about\ your\ application\ changing\ directory\ unless\ you\ explicitly\ do\ a\ cd\ yourself.\ \ (This\ behaviour\ is\ different\ from\ that\ of\ previous\ versions.)\n\nj:fs:fill_list\nUsage\n\tj:fs:fill_list\ listbox\n\nArgument\n\tlistbox\ is\ the\ listbox\ widget\ to\ fill\n\nDescription\nThis\ procedure\ fills\ a\ listbox\ with\ a\ list\ of\ the\ files\ in\ the\ current\ directory.\ \ The\ parent\ directory\ (`..')\ is\ first,\ followed\ by\ all\ filenames\ which\ don't\ start\ with\ a\ period,\ followed\ by\ those\ files\ that\ do\ start\ with\ a\ period.\ \ The\ current\ directory\ `.'\ does\ not\ appear.\ \ Other\ than\ that,\ files\ are\ listed\ in\ ASCII\ collating\ order.\n\nAny\ directory\ names\ will\ be\ followed\ by\ slashes\ (`/'),\ unless\ the\ global\ variable\ J_PREFS(j_fs_fast)\ is\ true.\n\nThis\ procedure\ is\ for\ use\ by\ j:fs.\ \ You\ may\ find\ it\ useful\ for\ other\ applications,\ but\ don't\ rely\ on\ it\ too\ much.\n\nEvolution\nFeel\ free\ to\ report\ bugs\ (and\ feature\ requests)\ to\ me,\ <js@bu.edu>,\ and\ I\ will\ try\ to\ deal\ with\ them.\ \ Also,\ feel\ free\ to\ fix\ bugs\ or\ add\ features\ on\ your\ own\ and\ let\ me\ know\ how\ you\ did\ it.\n\nBugs\ and\ Limitations\n*\ The\ value\ given\ by\ \[pwd\]\ isn't\ always\ the\ most\ appropriate\ way\ to\ refer\ to\ a\ directory,\ for\ instance\ if\ the\ automounter\ is\ being\ used.\n\n*\ It's\ non¡orthogonal\ that\ j:fs\ returns\ the\ filename\ as\ the\ procedure's\ return\ value,\ but\ returns\ the\ file\ type\ in\ a\ variable\ as\ a\ side¡effect.\ \ I\ can't\ think\ of\ a\ better\ way\ to\ do\ it,\ though,\ since\ I\ want\ the\ common\ case\ (not\ specifying\ a\ list\ of\ file\ types)\ to\ be\ as\ terse\ and\ intuitive\ as\ possible.\n\nFuture\ Directions\n*\ More\ buttons\ should\ be\ available\ for\ j:fs\ -\ things\ that\ spring\ to\ mind\ are\ a\ `make\ directory'\ button\ and\ a\ `preview'\ button.\ \ Also,\ there\ should\ be\ a\ way\ for\ the\ calling\ procedure\ to\ add\ arbitrary\ buttons\ to\ the\ j:fs\ panel.\n\n*\ There\ should\ be\ a\ way\ to\ let\ the\ user\ select\ a\ file\ format.\ \ Also,\ it\ might\ be\ nice\ to\ let\ the\ user\ preview\ a\ file\ before\ selecting\ it.\n\nChanges\n*\ The\ j:fs\ procedures\ used\ to\ be\ in\ a\ file\ called\ jlibrary.tcl.\ \ Starting\ with\ version\ 3.6/3.0,\ they're\ in\ their\ own\ independent\ library.\n\n*\ j:fs\ used\ to\ result\ in\ a\ cd\ to\ the\ directory\ in\ which\ the\ user\ selected\ a\ file\ (or\ the\ directory\ the\ user\ selected).\ \ It\ no\ longer\ does.\ \ (Well,\ actually,\ it\ does\ while\ it's\ filling\ in\ the\ listbox,\ but\ theen\ it\ cds\ back.)\ \ If\ you\ want\ your\ script\ to\ cd\ to\ the\ directory\ the\ user\ left\ the\ file\ selector\ panel\ in,\ do\ so\ explicitly\ based\ on\ the\ name\ returned.\n\n*\ The\ options\ for\ dealing\ with\ file\ types\ (and\ hence\ the\ ability\ to\ let\ the\ user\ select\ a\ file\ type)\ are\ new. {{{jdoc:xref:link {4.50 4.57 10.208 10.229 10.237 10.254 10.258 10.279 23.0 23.4 24.0 24.14 72.227 72.255 72.267 72.286 72.291 72.305 74.58 74.73 74.77 74.89 90.29 90.33}} {jdoc:xref:manpage {10.124 10.131}} {jdoc:anchor:anchorname {3.0 4.0 8.0 9.0 12.0 13.0 21.0 22.0 26.0 27.0 78.0 79.0 92.0 93.0}} {richtext:font:roman {4.0 4.4 4.11 4.50 4.57 6.24 6.31 8.0 10.0 10.20 10.27 10.100 10.109 10.124 10.131 10.212 10.219 10.241 10.246 10.258 10.279 12.0 14.0 15.0 15.9 16.0 16.21 17.0 19.0 19.4 19.11 21.0 23.4 24.0 24.14 24.22 24.26 26.0 28.6 28.7 28.14 30.0 31.22 31.31 31.47 32.0 32.17 32.26 32.39 33.0 33.17 33.26 33.27 34.0 34.27 34.36 34.38 35.0 35.25 35.34 35.39 36.0 36.15 36.24 36.37 37.0 37.18 37.27 37.29 38.0 38.24 38.33 38.35 39.0 39.25 39.34 39.44 41.0 45.36 46.0 50.0 51.0 52.0 52.99 52.105 52.194 52.204 52.393 52.396 52.499 52.504 54.109 54.117 54.147 54.157 54.199 54.205 54.413 54.421 54.451 54.453 54.455 54.461 54.467 54.471 54.503 54.505 58.0 58.2 58.50 58.52 60.0 60.6 60.9 60.11 60.78 60.83 62.0 62.4 62.7 62.9 64.0 64.4 64.7 64.9 66.0 66.4 68.0 68.6 68.16 68.27 70.3 70.9 70.14 70.27 70.70 70.80 70.150 70.158 70.165 70.169 70.202 70.209 70.250 70.258 72.27 72.45 72.114 72.115 72.291 72.305 74.58 74.73 74.77 74.89 74.120 74.130 74.187 74.198 74.217 74.227 74.255 74.261 74.265 74.275 76.16 76.20 76.116 76.120 76.121 76.123 76.240 76.244 76.364 76.366 78.0 80.23 82.0 83.0 83.1 83.8 85.0 86.0 86.106 86.108 88.50 88.51 88.82 88.100 90.29 90.33 92.0 92.9 93.55 93.66 95.0 95.20 96.21 96.26 98.27 98.31 100.0 101.0 101.39 101.43 101.214 101.218 105.0 105.7 106.6 106.10 106.50 106.62 108.2 108.6 108.27 108.29 108.213 108.215 108.252 108.254 110.109}} {richtext:font:italic {28.7 28.14 31.10 31.20 32.9 32.15 33.12 33.15 34.14 34.25 35.14 35.24 36.8 36.13 37.8 37.16 38.15 38.22 39.13 39.23 52.99 52.105 52.194 52.204 52.499 52.504 54.147 54.157 68.16 68.27 70.70 70.80 70.150 70.158 70.202 70.209 70.250 70.258 74.120 74.130 74.187 74.198 74.265 74.275 80.16 80.23 83.1 83.8}} {richtext:font:bold {2.0 3.0 4.4 4.11 4.50 4.57 6.24 6.31 10.20 10.27 10.212 10.219 19.4 19.11 52.393 52.396 54.199 54.205 72.291 72.305 74.77 74.89 74.217 74.227 86.106 86.108 106.50 106.62}} {richtext:font:bolditalic {10.241 10.246 10.258 10.279}} {richtext:font:typewriter {10.100 10.109 10.124 10.131 15.0 15.9 16.0 16.21 23.0 23.4 24.0 24.14 24.22 24.26 28.0 28.6 31.0 31.10 31.20 31.22 31.31 31.47 32.0 32.9 32.15 32.17 32.26 32.39 33.0 33.12 33.15 33.17 33.26 33.27 34.0 34.14 34.25 34.27 34.36 34.38 35.0 35.14 35.24 35.25 35.34 35.39 36.0 36.8 36.13 36.15 36.24 36.37 37.0 37.8 37.16 37.18 37.27 37.29 38.0 38.15 38.22 38.24 38.33 38.35 39.0 39.13 39.23 39.25 39.34 39.44 42.0 45.36 46.0 50.0 54.109 54.117 54.413 54.421 54.451 54.453 54.455 54.461 54.467 54.471 54.503 54.505 58.0 58.2 58.50 58.52 60.0 60.6 60.9 60.11 60.78 60.83 62.0 62.4 62.7 62.9 64.0 64.4 64.7 64.9 66.0 66.4 68.0 68.6 70.3 70.9 70.14 70.27 70.165 70.169 72.27 72.45 72.114 72.115 74.58 74.73 74.255 74.261 76.16 76.20 76.116 76.120 76.121 76.123 76.240 76.244 76.364 76.366 80.0 80.16 88.50 88.51 88.82 88.100 90.29 90.33 93.55 93.66 96.21 96.26 98.27 98.31 101.39 101.43 101.214 101.218 106.6 106.10 108.2 108.6 108.27 108.29 108.213 108.215 108.252 108.254}} {richtext:font:heading0 {1.0 2.0}} {richtext:font:heading1 {3.0 4.0 8.0 9.0 12.0 13.0 21.0 22.0 26.0 27.0 78.0 79.0 92.0 92.9 100.17 101.0}} {richtext:font:heading2 {9.0 10.0 13.0 14.0 17.0 19.0 22.0 23.0 27.0 28.0 30.0 31.0 41.0 42.0 51.0 52.0 79.0 80.0 82.0 83.0 85.0 86.0 95.0 95.20 100.0 100.17 105.0 105.7}} {{} {2.0 3.0 4.4 4.7 6.24 6.27 11.0 19.4 19.12 21.0 22.0 23.0 26.0 36.38 39.45 41.0 41.7 41.8 42.0 45.36 49.58 51.0 52.0 54.404 54.534 58.2 58.5 58.78 58.81 59.0 60.0 60.6 60.9 60.57 60.59 61.0 62.0 62.4 62.8 62.38 62.39 63.0 64.0 64.4 64.7 64.31 64.32 65.0 66.0 66.4 66.7 66.56 66.58 67.0 68.0 68.6 68.9 69.0 72.0 72.222 72.305 74.74 74.89 75.0 77.0 92.0 95.0 96.0 96.2 97.0 99.0 100.0 101.2 102.0 106.8 106.10}} {jdoc:link:jstools.jdoc {4.50 4.57}} {jdoc:manpage:tclvars {10.124 10.131}} {jdoc:link:jslibraries.jdoc#Usage {10.237 10.254}} {jdoc:link:jslibraries.jdoc {10.208 10.229 10.258 10.279}} {jdoc:anchorname:Evolution {92.0 93.0}} {jdoc:anchorname:Credits_and_Copyright {12.0 13.0}} {jdoc:anchorname:Introduction {3.0 4.0}} {jdoc:anchorname:Overview {21.0 22.0}} {jdoc:link:jtkutils.tcl.jdoc {74.77 74.89}} {jdoc:link:jprefpanel.tcl.jdoc#j:global_pref_panel {72.267 72.286}} {jdoc:anchorname:Usage {8.0 9.0}} {jdoc:topic:jstools {4.50 4.57}} {jdoc:section:j:fs:fill_list {24.0 24.14}} {jdoc:section:j:fs {23.0 23.4}} {jdoc:link:#j:fs {23.0 23.4 90.29 90.33}} {jdoc:link:#j:fs:fill_list {24.0 24.14}} {jdoc:anchorname:j:fs {26.0 27.0}} {jdoc:link:jtkutils.tcl.jdoc#j:cancel_button {74.58 74.73}} {jdoc:link:jprefpanel.tcl.jdoc {72.291 72.305}} {jdoc:anchorname:j:fs:fill_list {78.0 79.0}} {jdoc:link:panels/prefs.jdoc {72.227 72.255}}} {{del_from 110.109} {matchend 51.11} {abbrevstart 10.247} {abbrevend 10.279} {insert 1.0} {del_to 99.0} {matchstart 51.0} {anchor 106.94} {emacs_mark 110.109} {current 10.81}}}